<?php
require_once dirname(__FILE__) . "/adminManager.php";
if (! deal_session()) {
    errorMessage("你没有权限这样做");
}
global $_G;

define('IN_ADMIN', true);
if (isset($_GET["model"])) {
    $_G["admin"]["model"] = $_GET["model"];
    $model = $_G["admin"]["model"];
    if (isset($_GET["op"])) {
        $_G["admin"]["op"] = $_GET["op"];
    }
} else {
 die();
}
loadModel($model);
errorMessage("无效的参数，未知的请求类型2");

function errorMessage($mes)
{
    die(json_encode(array(
        "state" => 0,
        "message" => "$mes"
    )));
}

function loadModel($name)
{
    require_once dirname(__FILE__) . '/models/admin_' . $name . '.php';
    die();
}
?>